package com.ruoyi.information.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.information.mapper.InterviewPositionMapper;
import com.ruoyi.information.domain.InterviewPosition;
import com.ruoyi.information.service.IInterviewPositionService;

/**
 * 岗位Service业务层处理
 * 
 * @author Ly
 * @date 2025-06-13
 */
@Service
public class InterviewPositionServiceImpl implements IInterviewPositionService 
{
    @Autowired
    private InterviewPositionMapper interviewPositionMapper;

    /**
     * 查询岗位
     * 
     * @param id 岗位主键
     * @return 岗位
     */
    @Override
    public InterviewPosition selectInterviewPositionById(Long id)
    {
        return interviewPositionMapper.selectInterviewPositionById(id);
    }

    /**
     * 查询岗位列表
     * 
     * @param interviewPosition 岗位
     * @return 岗位
     */
    @Override
    public List<InterviewPosition> selectInterviewPositionList(InterviewPosition interviewPosition)
    {
        return interviewPositionMapper.selectInterviewPositionList(interviewPosition);
    }

    /**
     * 新增岗位
     * 
     * @param interviewPosition 岗位
     * @return 结果
     */
    @Override
    public int insertInterviewPosition(InterviewPosition interviewPosition)
    {
        interviewPosition.setCreateTime(DateUtils.getNowDate());
        return interviewPositionMapper.insertInterviewPosition(interviewPosition);
    }

    /**
     * 修改岗位
     * 
     * @param interviewPosition 岗位
     * @return 结果
     */
    @Override
    public int updateInterviewPosition(InterviewPosition interviewPosition)
    {
        interviewPosition.setUpdateTime(DateUtils.getNowDate());
        return interviewPositionMapper.updateInterviewPosition(interviewPosition);
    }

    /**
     * 批量删除岗位
     * 
     * @param ids 需要删除的岗位主键
     * @return 结果
     */
    @Override
    public int deleteInterviewPositionByIds(Long[] ids)
    {
        return interviewPositionMapper.deleteInterviewPositionByIds(ids);
    }

    /**
     * 删除岗位信息
     * 
     * @param id 岗位主键
     * @return 结果
     */
    @Override
    public int deleteInterviewPositionById(Long id)
    {
        return interviewPositionMapper.deleteInterviewPositionById(id);
    }

    /**
     * 列出所有岗位
     * @return
     */
    @Override
    public List<InterviewPosition> listAll() {
        return interviewPositionMapper.selectAll();
    }

    /**
     * 更改岗位状态
     * @param interviewPosition
     * @return
     */
    @Override
    public int changeStatus(InterviewPosition interviewPosition) {
        return interviewPositionMapper.updateInterviewPositionStatus(interviewPosition);
    }
}
